//时间格式化
String formatTime(date, {String match}){
  date = DateTime.fromMillisecondsSinceEpoch(date);

  var year = date.year;
  var month = date.month;
  var day = date.day;
  var hour = date.hour;
  var minute = date.minute;
  var second = date.second;

  RegExp reg = new RegExp(r"y|m|d|h|i|s");
  match = match ?? 'y-m-d';

  return match.replaceAllMapped(reg, (matches){
    for(int i=0; i<matches.groupCount+1; i++){
      String mat = matches.group(i);
      return ({
        'y': year,
        'm': month,
        'd': day,
        'h': hour,
        'i': minute,
        's': second
      })[mat].toString();
    }
  });
}